package crm.system.controller;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import crm.base.controller.BaseController;
import crm.base.model.Page;
import crm.base.util.SpringSecurityUtils;
import crm.system.model.AgentManageModel;
import crm.system.service.AgentService;

@Controller
@RequestMapping("/agentManage")
public class AgentManageController extends BaseController {
	
	@Autowired
	private AgentService agentService;

	@RequestMapping("/list")
	public ModelAndView list(AgentManageModel model) {
		
		System.out.println(SpringSecurityUtils.getCurrentUserName());
		
		Map<String, ?> params = new HashMap<String, Object>();
		Page page = agentService.getAgentPageList(params, model.getPage());
		model.setPage(page);
		return forword("system/agentlist", model);
	}

}
